home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / System Extensions / Macintosh Drag and Drop 1.1.1 / Demo Applications / DragText Sources / windows.c < prev   
Encoding:
C/C++ Source or Header  |  1992-03-01  |  1.1 KB  |  65 lines  |  [TEXT/KAHL]

  1. /*
  2.  *
  3.  *        windows.c
  4.  *
  5.  *        Window handling routines.
  6.  *        
  7.  *
  8.  *        Author:        Rob Johnston
  9.  *        Date:        Monday, January 20, 1992
  10.  *
  11.  *        Copyright © 1992 Apple Computer, Inc.
  12.  *
  13.  */
  14.  
  15.  
  16. #include "globals.h"
  17.  
  18.  
  19. /*
  20.  *    UpdateWindow is called when an update event is received for a docuemnt
  21.  *    window.
  22.  */
  23.  
  24. void UpdateWindow(Document *theDocument)
  25.  
  26. {    WindowPtr        theWindow;
  27.  
  28.     theWindow = theDocument->theWindow;
  29.  
  30.     SetPort(theWindow);
  31.     BeginUpdate(theWindow);
  32.  
  33.     EraseRect(&theWindow->portRect);
  34.  
  35.     DrawControls(theWindow);
  36.     DrawGrowIcon(theWindow);
  37.  
  38.     TEUpdate(&theWindow->portRect, theDocument->theTE);
  39.  
  40.     EndUpdate(theWindow);
  41. }
  42.  
  43.  
  44. /*
  45.  *    GrowDocumentWindow is called when the user clicks in the growRgn of a
  46.  *    document window.
  47.  */
  48.  
  49. void GrowDocumentWindow(WindowPtr theWindow, Point thePoint)
  50.  
  51. {    long        result;
  52.     Rect        sizeRect;
  53.  
  54.     SetPort(theWindow);
  55.  
  56.     sizeRect = screenBits.bounds;
  57.     if (!(result = GrowWindow(theWindow, thePoint, &sizeRect)))
  58.         return;
  59.     SizeWindow(theWindow, LoWord(result), HiWord(result), false);
  60.     PositionDocumentParts((Document *) ((WindowPeek) theWindow)->refCon);
  61.     AdjustScrollBar((Document *) ((WindowPeek) theWindow)->refCon);
  62.     InvalRect(&theWindow->portRect);
  63. }
  64.  
  65.